Skip to content

[WIP] Added automatic DPI scaling to editor#626

Closed
adriengivry wants to merge 3 commits intomainfrom
feature/dpi_scaling
Closed

[WIP] Added automatic DPI scaling to editor#626
adriengivry wants to merge 3 commits intomainfrom
feature/dpi_scaling

Conversation

@adriengivry
Copy link
Copy Markdown
Member

@adriengivry adriengivry commented Dec 3, 2025

Description

This PR enables the following ImGui config flags:

  • ImGuiConfigFlags_DpiEnableScaleViewports
  • ImGuiConfigFlags_DpiEnableScaleFonts

Note: ImGui mentions:

ImGuiConfigFlags_DpiEnableScaleViewports= 1 << 14,  // [BETA: Don't use] FIXME-DPI: Reposition and resize imgui windows when the DpiScale of a viewport changed (mostly useful for the main viewport hosting other window). Note that resizing the main window itself is up to your application.
ImGuiConfigFlags_DpiEnableScaleFonts    = 1 << 15,  // [BETA: Don't use] FIXME-DPI: Request bitmap-scaled fonts to match DpiScale. This is a very low-quality workaround. The correct way to handle DPI is _currently_ to replace the atlas and/or fonts in the Platform_OnChangedViewport callback, but this is all early work in progress.

So we might need to do more investigation whether this is the right approach.

Edit: It seems like these config options do not exist anymore on ImGui's latest.
Edit 2: These options are now in ImGuiIO, as ConfigDpiScaleFonts and ConfigDpiScaleViewports

To-Do:

  • Fix some buttons don't scale properly
  • Validate on a variety of screen sizes

Related Issue(s)

Fixes #(issue number)

Review Guidance

Write here.

Screenshots/GIFs

MacBook Pro M1 (Asahi Linux) 3456x2160

Before After
image image

@adriengivry adriengivry self-assigned this Dec 3, 2025
@adriengivry adriengivry added QoL Quality of Life : Something that can improve users productivity Editor Something relative with the editor labels Dec 3, 2025
@adriengivry
Copy link
Copy Markdown
Member Author

Seems like this should be handled fairly well with newer versions of imgui!
https://github.com/ocornut/imgui/blob/2cbdb7a337af7da5cfe6adf320f0e84ef56bee01/docs/FONTS.md?plain=1#L84

We should probably look into upgrading ImGUI to its latest version and use this feature.

Follow-up issue: #713

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Editor Something relative with the editor QoL Quality of Life : Something that can improve users productivity

Development

Successfully merging this pull request may close these issues.

1 participant